import { ColorItem } from "./ColorItem";
import { EventName } from "../../mvc/EventName";
import { DataEvent } from "../../events/DataEvent";
//class ColorPanel
    
    export  class ColorPanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            var loc1=new Array<any>(16763904, 268435200, 65280, 255, 16711935);
            this.init(loc1);
            return;
        }

        /* internal  */init(arg1: Array<any>): void
        {
            var loc4=null;
            var loc1=0;
            var loc2=arg1.length;
            var loc3=0;
            while (loc3 < loc2) 
            {
                (loc4 = new ColorItem(arg1[loc3])).x = 0;
                loc4.y = loc1;
                loc1 = loc1 + loc4.height;
                loc4.addEventListener(EventName.ChatColorSelect, this.onChatColorSelectHandler);
                addChild(loc4);
                ++loc3;
            }
            return;
        }

        /* internal  */onChatColorSelectHandler(arg1: DataEvent): void
        {
            dispatchEvent(new DataEvent(EventName.ChatColorSelect, arg1.data));
            return;
        }
    }
